using System.Runtime.InteropServices;

namespace Voodoo.Sauce.Core
{
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct ProductPurchaseEvent
	{
		private const string ConsumableProductEventName = "purchase_consumable";

		private const string NotConsumableProductEventName = "purchase_nonconsumable";

		private const string SubscriptionProductEventName = "purchase_subscription";

		private const string UnknownProductEventName = "product_unknown";

		private const string NoAdsProductEventName = "purchase_noads";

		internal static string GetAdjustName(string productId, PurchaseProductType productType, string noAdsBundleId)
		{
			if (productId == noAdsBundleId)
			{
				return "purchase_noads";
			}
			return productType switch
			{
				PurchaseProductType.Consumable => "purchase_consumable", 
				PurchaseProductType.NonConsumable => "purchase_nonconsumable", 
				PurchaseProductType.Subscription => "purchase_subscription", 
				_ => "product_unknown", 
			};
		}
	}
}
